#pragma once

#include <vector>
#include "opencv2/myopencv.hpp"
using namespace cv;
using namespace std;


class TObject
{
private:
	shared_ptr<Rect> rect;
	shared_ptr<Point2f> center;
	vector<TObject> children;
	string classType;

public:
	static const Scalar colors[];

public:
	TObject(void);
	~TObject(void);
	void clear(void);

	void drawOn(Mat& img);
	void drawOn(Mat& img, const Scalar& c1, const Scalar& c2=colors[0]);
	void draw(Mat& img);
	void addChild(TObject c);
	void setCenter(Point2f c);
	void setRect(Rect r);
	void setType(string val) { classType = val; }

	unsigned int getChildrenSize(void) const {return children.size();}
	
	string getType() const { return classType; }
	Point2f* getCenter(void) const {return center.get();}
	Rect* getRect(void) const {return rect.get();}
	const vector<TObject>& getChildren(void) const {return children;}
	const TObject& getChild(int idx) const {return children[idx];}
// 	vector<TObject>& getChildren(void) {return children;}
// 	TObject& getChild(int idx) {return children[idx];}
};

